#include "widget.h"
#include "ui_widget.h"
#include <QIcon>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    srand(time(0));

    //QIcon icon("://th.jpg");
    QIcon icon1("c:/windowPicture/th.jpg");
    setWindowIcon(icon1);
    setWindowTitle("第五人格");
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_clicked()
{
    ui->label->setText("马上来!!!");
}

void Widget::on_pushButton_2_pressed()
{
    QRect rect = geometry();
    ui->label->setText("第五人格启动！！！");
    int x = rand() % rect.width();
    int y =rand() % rect.height();
    ui->pushButton_2->move(x, y);
}
